//#define RAND_MAX 65535
#include <stdlib.h>
double frand(){
  return 1.0 *rand() / RAND_MAX;
}

//-------------------------------------------------------------------------

int main(){
  int N = 200000000, M = 0;
  int i;
  for (i = 0; i < N; i++){
    double x = frand();
    double y = frand();
    if (x *x + y * y <= 1)
      ++M;
  }
  double pi = 4.0 * M / N;
  printf("%.6f\n", pi);
  return 0;
}
